<script setup>
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
function initChart() {
  const option = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    legend: {},
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    yAxis: {
      type: 'value',
      boundaryGap: [0, 0.01]
    },
    xAxis: {
      type: 'category',
      data: ['01月', '02月', '03月', '04月', '05月', '06月', '07月', '08月', '09月', '10月', '11月', '12月']
    },
    series: [
      {
        name: '2011',
        type: 'bar',
        data: [182003, 23489, 29034, 104970, 130744, 630230, 103445, 100230, 114104, 104240, 109350]
      },
      {
        name: '2012',
        type: 'bar',
        data: [19325, 23438, 31000, 121594, 104141, 681807, 103445, 100230, 114104, 104240, 109350]
      }
    ]
  }
  echarts.init(document.getElementById('echart-dom')).setOption(option)
}
onMounted(() => {
  initChart()
})
</script>

<template>
  <div class="wrapper">
    <div id="echart-dom"></div>
  </div>
</template>

<style lang="scss" scoped>
.wrapper {
  flex: 1;
  height: 100%;
  margin: 0 20px;
  #echart-dom{
    width: 100%;
    height: 100%;
  }
}
</style>
